import * as os from 'os';
import * as path from 'path';
import * as fs from 'fs';

export function getMySqlUsernameAndPassword() {
  const homeDir = os.homedir();
  const usernamePath = path.resolve(homeDir, '.vben', 'username');
  const passwordPath = path.resolve(homeDir, '.vben', 'password');
  const username = fs.readFileSync(usernamePath).toString().trim();
  const password = fs.readFileSync(passwordPath).toString().trim();
  return {
    username,
    password,
  };
}
